import Vue from "vue";

export default Vue.extend({
  template: `
        <div v-show="visible" style="display: flex;justify-content: center;">
            <!--<button style="height: 20px; line-height: 0.5" v-on:click="invokeParentMethod" class="btn btn-info">查看详情</button>-->
            <LinkButton 
              iconCls="icon-search" 
              style="height: 24px; line-height: 0.5" 
              v-on:click="invokeParentMethod" 
              text="查看详情" 
              />
        </div>
    `,
  data: function() {
    return {
      visible: true
    };
  },
  beforeMount() {
    this.visible = this.params.value !== "false";
  },
  mounted() {},
  methods: {
    invokeParentMethod() {
      // this.params.context.componentParent.customButtonClick(`Row: ${this.params.node.rowIndex}, Col: ${this.params.colDef.headerName}`);
      this.params.context.componentParent.onCustomButtonClick(this.params.node);
    }
  }
});
